<template>
	<view class="business">
		<view class="nav d_f j_c_c a_i_c">
			<view class="text">My Wallet</view>
			<image src="../../static/ct_0031_返回键.png" mode="" class="right" @tap="back"></image>
		</view>
		<image src="../../static/ct_0012_绿色顶.png" mode="" class="header"></image>
		<view class="header_text" @click="project">Project</view>
		<view class="box">
			<view class="title">USDT</view>
			<view class="money">${{data.money}}</view>
		</view>
		<view class="index">
			<view class="w_100 d_f j_c_s_b a_i_c">
				<view class="Transfer d_f j_c_c a_i_c" @tap="continueUp">Deposit</view>
				<view class="Transfer d_f j_c_c a_i_c" @tap="recharge">Withdraw</view>
			</view>
			<view class="show"></view>
			<view class="d_f j_c_s_b a_i_c top">
				<view class="d_f">Project income/day : <view class="size">+{{data.statics}}</view>
				</view>

				<view class="details d_f j_c_c a_i_c" @tap="incomDetails">Details</view>
			</view>
			<view class="friends" >Project funded quota :+{{data.quota}}</view>
			<!-- <view class="d_f quota">Project funded quota : <view class="size">+{{data.quota}}</view> -->
			<!-- </view> -->
			<view class="d_f j_c_s_b a_i_c top">
				<view class="d_f">My salary/day (USDT) : <view class="size">+{{data.salary}}</view>
				</view>
				<view class="details d_f j_c_c a_i_c" @tap="businessDetails">Details</view>
			</view>
			<view class="friends" @tap="today">{{data.today}}</view>
			<view class="d_f j_c_s_b a_i_c top">
				<view class="d_f">promotion reward:+{{data.reach}}% : <view class="size">+{{data.dynamic}}</view>
				</view>
				<view class="details d_f j_c_c a_i_c" @tap="inviteDetails">Details</view>
			</view>
			<view class=" friends" >my Friends : +{{data.friends}}</view>
			<!-- <view class="d_f friends"><view class="size">+{{data.friends}}</view>
			</view> -->
			<view class="tips">This is your wallet in OPENAI. Please keep your asset safe. Don't disclose your wallet
				password or mnemonics to others, including us. Thank you for using OPAI wallet.</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				data: {},
			}
		},
		components: {

		},
		methods: {
			back() {
				uni.reLaunch({
					url: '/pages/index/index'
				});
			},
			//获取钱包数据
			getData() {
				this.$api.mywalletData().then(res => {
					this.data = res.data
				})
			},
			//转账
			continueUp() {
				uni.navigateTo({
					url: '/pages/index/accounts'
				})
			},
			//充值
			recharge() {
				uni.navigateTo({
					url: '/pages/index/recharge'
				})
			},
			//个人收益跳转
			incomDetails() {
				uni.navigateTo({
					url: '/pages/index/income'
				})
			},
			//我的工资
			businessDetails() {
				uni.navigateTo({
					url: '/pages/index/business'
				})
			},
			//邀请奖励
			inviteDetails() {
				uni.navigateTo({
					url: '/pages/index/inviteDay'
				})
			},
			//签到
			today() {
				if (this.data.today == 'unsigned today') {
					uni.navigateTo({
						url: '/pages/index/signIn'
					})
				}
			},
			project(){
				uni.navigateTo({
					url:'/pages/index/signIn'
				})
			}
		},
		onShow() {

		},
		onLoad(options) {
			this.getData()
		},
		watch: {

		},
		computed: {

		}
	}
</script>

<style scoped lang='scss'>
	.business {
		width: 100%;
		min-height: 100%;
		background: rgb(239, 237, 238);
		position: relative;

		.nav {
			width: calc(100% - 64rpx);
			height: 160rpx;
			margin-left: 32rpx;
			position: relative;
			z-index: 9999;

			.text {
				font-size: 32rpx;
				font-weight: 700;
				color: #FFFFFF;
			}

			.right {
				width: 20rpx;
				height: 32rpx;
				position: absolute;
				left: 0rpx;
				z-index: 999;
				transform: rotate(180deg);
			}
		}

		.header {
			position: absolute;
			top: 0rpx;
			width: 100%;
			height: 229rpx;
			z-index: 1;
		}
        .header_text{
			text-align: center;
			position: absolute;
			width: 100%;
			display: flex;
			top: 120rpx;
			justify-content: center;
			z-index: 99999;
			color: #fff;
			font-size: 32rpx;
			font-weight: 700;
		}
		.box {
			width: calc(100% - 64rpx);
			margin-left: 32rpx;
			margin-top: 100rpx;
			background-size: 100% 100%;
			padding: 32rpx 32rpx;
			background: #64ba8f;
			border-radius: 20rpx;
			height: 214rpx;
			color: #fff;
			font-weight: 700;

			.title {
				font-size: 32rpx;
			}

			.money {
				font-size: 60rpx;
				margin-top: 32rpx;
			}

		}

		.index {
			width: calc(100% - 64rpx);
			margin-left: 32rpx;
			margin-top: 32rpx;

			.Transfer {
				width: 160rpx;
				height: 60rpx;
				background: #fff;
				color: #64ba8f;
				border-radius: 20rpx;
			}

			.show {
				width: 100%;
				border: 0.5px solid #ccc;
				margin-top: 32rpx;
			}

			.top {
				margin-top: 64rpx;
				font-weight: 700;



				.details {
					width: 160rpx;
					height: 60rpx;
					background: #fff;
					color: #64ba8f;
					border-radius: 20rpx;
				}
			}

			.size {
				color: #E7623F;
			}

           .friends{
			  font-weight: 700;
			  margin-top: 16rpx;
			  /* width: 300rpx; */
			 padding: 10rpx 20rpx;
			  background: #fff;
			  color: #64ba8f;
			  border-radius: 20rpx;
			  display: inline-block !important;
			  margin-left: 26rpx; 
		   }

			.tips {
				margin-top: 64rpx;
				font-weight: 700;
				font-size: 24rpx;
				line-height: 40rpx;
			}
		}


	}
</style>
